package com.vhall.component.entity.redpacket.vo;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.vhall.component.framework.common.annotation.ParamName;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @author zhangtao
 */
@Data
@NoArgsConstructor
public class PageVO {

    /**
     * 开始游标
     */
    private Integer offset;

    /**
     * 每次查询取回的条数
     */
    private Integer limit;

    /**
     * 查询条件返回的总行数
     */
    private Integer count;

    /**
     * 查询条件返回的结果集
     */
    private List<?> list;

    /**
     * 排序类型：
     * asc 正序
     * desc 倒序
     */
    @JsonProperty("sort_type")
    @ParamName("sort_type")
    private String sortType;

    public PageVO(Integer offset, Integer limit) {
        this.offset = offset;
        this.limit = limit;
    }

    public PageVO(Integer offset, Integer limit, String sortType) {
        this.offset = offset;
        this.limit = limit;
        this.sortType = sortType;
    }
}
